package com.taobao.api.request;

import java.util.Date;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.TmallEaiOrderRefundGoodReturnCheckResponse;

/**
 * TOP API: tmall.eai.order.refund.good.return.check request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class TmallEaiOrderRefundGoodReturnCheckRequest implements TaobaoRequest<TmallEaiOrderRefundGoodReturnCheckResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 物流公司编号
   */
  private String              companyCode;

  /**
   * 1.验货通过 2.验货不通过
   */
  private Long                confirmResult;

  /**
   * 验货时间
   */
  private Date                confirmTime;

  /**
   * 验货人员
   */
  private String              operator;

  /**
   * 退款单编号
   */
  private Long                refundId;

  /**
   * 售中：onsale 售后：aftersale
   */
  private String              refundPhase;

  /**
   * 物流运单号
   */
  private String              sid;

  public void setCompanyCode(String companyCode) {
    this.companyCode = companyCode;
  }

  public String getCompanyCode() {
    return this.companyCode;
  }

  public void setConfirmResult(Long confirmResult) {
    this.confirmResult = confirmResult;
  }

  public Long getConfirmResult() {
    return this.confirmResult;
  }

  public void setConfirmTime(Date confirmTime) {
    this.confirmTime = confirmTime;
  }

  public Date getConfirmTime() {
    return this.confirmTime;
  }

  public void setOperator(String operator) {
    this.operator = operator;
  }

  public String getOperator() {
    return this.operator;
  }

  public void setRefundId(Long refundId) {
    this.refundId = refundId;
  }

  public Long getRefundId() {
    return this.refundId;
  }

  public void setRefundPhase(String refundPhase) {
    this.refundPhase = refundPhase;
  }

  public String getRefundPhase() {
    return this.refundPhase;
  }

  public void setSid(String sid) {
    this.sid = sid;
  }

  public String getSid() {
    return this.sid;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "tmall.eai.order.refund.good.return.check";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("company_code", this.companyCode);
    txtParams.put("confirm_result", this.confirmResult);
    txtParams.put("confirm_time", this.confirmTime);
    txtParams.put("operator", this.operator);
    txtParams.put("refund_id", this.refundId);
    txtParams.put("refund_phase", this.refundPhase);
    txtParams.put("sid", this.sid);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<TmallEaiOrderRefundGoodReturnCheckResponse> getResponseClass() {
    return TmallEaiOrderRefundGoodReturnCheckResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(companyCode, "companyCode");
    RequestCheckUtils.checkNotEmpty(confirmResult, "confirmResult");
    RequestCheckUtils.checkNotEmpty(confirmTime, "confirmTime");
    RequestCheckUtils.checkNotEmpty(refundId, "refundId");
    RequestCheckUtils.checkNotEmpty(refundPhase, "refundPhase");
    RequestCheckUtils.checkNotEmpty(sid, "sid");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
